package com.blockmeta.bbs.immodule.bean.sort;

import com.blockmeta.bbs.immodule.bean.beaninterface.IFriendsEntry;

import java.util.Comparator;

/**
 * @author AirThor
 * @date 2019/3/5.
 */
public class PinyinComparator implements Comparator<IFriendsEntry> {
    @Override
    public int compare(IFriendsEntry o1, IFriendsEntry o2) {
        if ("@".equals(o1.getLetter())
                || "#".equals(o2.getLetter())) {
            return -1;
        } else if ("#".equals(o1.getLetter())
                || "@".equals(o2.getLetter())) {
            return 1;
        } else {
            return o1.getLetter().compareTo(o2.getLetter());
        }
    }
}

